#pragma once
#ifndef ZOO_H_
#define ZOO_H_
#include<iostream>
#include<cstdio>
#include<string>
#include<cstdlib>
#include<map>
#include<ctime>

using namespace std;

class Money
{
private:
	double m;
public:
	Money() { m = 0; };
	Money(double i) { m = i; };
	~Money() {};
	const Money operator +(const Money & i) const;
	const Money operator -(const Money & i) const;
	const Money operator +=(const Money & i) const;
	const Money operator -=(const Money & i) const;
	const Money operator*(const Money &i) const;
	const Money operator*=(const Money &i) const;
};

struct animalfood
{
	string foodtype;
	double amount;
	animalfood() {
		foodtype = "\0";
		amount = 0;
	}
};

struct animalenclosure
{
	double dirtlevel;
	bool status;
};

class Animal
{
private:
	double weight;
	string food;
	double limit_weight;
public:
	Animal() { weight = 0; limit_weight = 0; food = "\0"; };
	void setAnimal(double i, double j, string s)
	{
		weight = i;
		limit_weight = j;
		food = s;
	}
	~Animal()
	{
	}
	virtual void eatfood(double) = 0;
	virtual bool getstatus()=0;
	double getweight() { return weight; };
	double getlimit() { return limit_weight; }
	string return_foodkind() { return food; };
	void addfood(double i) { weight += i; }
};

class Elephant :public Animal
{
private:
	double trunk_length;
	animalenclosure enclosure;
public:
	Elephant();
	Elephant(double i);
	~Elephant() ;
	void eatfood(double i) ;
	double return_dirtlevel();
	void setstatus(bool);
	bool getstatus();
	void reset_dirty();
};

class Giraffe :public Animal
{
private:
	double neck_length;
	animalenclosure enclosure;
public:
	Giraffe();
	Giraffe(double i);
	~Giraffe() ;
	void eatfood(double i);
	double return_dirtlevel() ;
	void setstatus(bool);
	bool getstatus();
	void reset_dirty();
};

class Monkey :public Animal
{
private:
	double arm_length;
	animalenclosure enclosure;
public:
	Monkey();
	Monkey(double i);
	~Monkey() ;
	void eatfood(double i) ;
	double return_dirtlevel();
	void setstatus(bool);
	bool getstatus();
	void reset_dirty();
};

class Person
{
private:
	double age;
	string name;
public:
	Person() { age = 0; name = "\0"; };
	~Person() {};
	void setperson(string i, double k)
	{
		name = i;
		age = k;
	}

};

class ZooKeeper :public Person
{
private:
	double cleaning_days;
public:
	ZooKeeper();
	void setZooKeeper(string, double);
	~ZooKeeper();
	void addcleaning_day();
	double return_cleaningdays();
};

class FoodSeller :public Person
{
private:
	static string foodkind[3];
	static double foodamout[3];
	static double foodprice[3];
	double amount_monye;
	bool closefor[3];
public:
	FoodSeller();
	void setFoodSeller(string, double);
	~FoodSeller();
	bool sellfood(string, double);
	double getfood_amount(string);
	double getfood_price(string);
	void selltickets(int, int);
	double return_money();
};

class Visitor :public Person
{
private:
	double pass_id;
public:
	Visitor();
	void setVisitor(string, double,double);
	~Visitor();
};

class Child :public Visitor
{
private:
	animalfood food[3];
public:
	Child();
	void setChild(string, double, double);
	~Child();
	void get_animal_food(int,double,string);
	void feed_food(Animal & i);

};

class Adult :public Visitor
{
private:
	double money;
	double child_number;
	Child *child;
	animalfood food[3];
public:
	Adult();
	~Adult();
	void setadult(double, double);
	void setchild(string, double, double,int);
	void buy_animalfood(FoodSeller&);	
	void distribute();
	void fed_animals(Animal & );
};

class Zoo
{
private:
	int dayly_adult;
	int dayly_child;
	int total_adult;
	int total_child;
	int total_visitors;
	int total_days;
	int on_day;
	int closeday[6];
	FoodSeller seller;
	Elephant elephant;
	Giraffe giraffe[2];
	Monkey monkey[3];
	ZooKeeper keeper;
	Adult * adult;
public:
	Zoo();
	~Zoo();
	void setzoo_newday(int,int);
	void buytickets();
	void buyfood();
	void fed_food();
	void dayover();
	void  show_days_open();
	void show_totnumber();
	void show_reason_close();
	void check_animal_dirty();
	 int check_close();
	void seller_money();
	void showall();
};
#endif // !zoo_h_

